<% layout('/layouts/default.html', {title: '单据配置管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(billConfig.isNewRecord ? '新增单据配置' : '编辑单据配置')}
			</div>
			<div class="box-tools pull-right hide">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${billConfig}" action="${ctx}/billconfig/billConfig/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit hide">${text('基本信息')}</div>
				<#form:hidden path="autoId"/>
				<#form:hidden path="orgId"/>
				<#form:hidden path="orgCode"/>
				<#form:hidden path="orgName"/>
				<#form:hidden path="createName"/>
				<#form:hidden path="updateName"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> ${text('单据类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-4">
								<#form:select path="formId" blankOption="true" blankOptionLabel="请选择" items="${formList}" itemLabel="name" itemValue="id" class="form-control required" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> ${text('是否推单')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-4">
								<#form:radio path="pushFlag" defaultValue="1" dictType="sys_yes_no"
								class="form-control required" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('拆条码规则')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-4">
								<#form:radio path="splitBarcodeRule" dictType="split_barcode_rule"
								class="form-control" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('合条码规则')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-4">
								<#form:radio path="mergeBarcodeRule" dictType="merge_barcode_rule"
								class="form-control" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('备注')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:textarea path="remarks" rows="4" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('billconfig:billConfig:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$('#inputForm').validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>